/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.gov.mtc.dgac.licencias.service;

import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import pe.gov.mtc.dgac.licencias.bean.PaisTO;
import pe.gov.mtc.dgac.licencias.bean.UbigeoTO;
import pe.gov.mtc.dgac.licencias.exception.BusinessException;
import pe.gov.mtc.dgac.licencias.exception.TransactionException;
import pe.gov.mtc.dgac.licencias.persistence.UbigeoDAO;
import pe.gov.mtc.dgac.licencias.struts.Constants;

/**
 *
 * @author German
 */
public class UbigeoImplService implements UbigeoService{
   private UbigeoDAO dao;
   Log logger = LogFactory.getLog(this.getClass());
     
    public UbigeoImplService(UbigeoDAO dao){
      this.dao=dao;
    }
    public List<UbigeoTO> listUbigeo(Long ubigeoid) throws BusinessException {
      try {
            return dao.listUbigeo(ubigeoid);
       }catch(Exception e){
          logger.error(e);
	  throw new BusinessException(Constants.MESSAGE_ERROR_CONSULTA.getValue(),e);
        }
    }

    public List<PaisTO> listPaises(String codpais) throws BusinessException {
       try {
            return dao.listPaises(codpais);
       }catch(Exception e){
          logger.error(e);
	  throw new BusinessException(Constants.MESSAGE_ERROR_CONSULTA.getValue(),e);
        }
    }

}
